package java基础知识.java常用类;

/**
 * @author coderFu
 * @create 2022/3/10
 * StringBuffer变长字符串
 */
public class CoderStringBuffer {

    public static void main(String[] args) {

        // 初始的存储容量是16
        StringBuffer sb = new StringBuffer(2);
        sb.append("a");
        sb.append("av");

        int capacity = sb.capacity();
        System.out.println(capacity);
        sb.append("abcd");
        int capacity1 = sb.capacity();
        System.out.println(capacity1);
    }
}
